import json

# 1.从文件加载
data = None
with open('test.json', 'r') as fp:
    data= json.load(fp)
    print(data)

# 2.修改
data['name'] = 'Tom'

# 3.保存到文件
with open('test.json', 'w') as fp:
    json.dump(data, fp)
